<!DOCTYPE html>
<html class="">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="/css/drag.css">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all" />
    <title>后台管理</title>
</head>
<body>
<div class="wrapper">

    <div class="container">
        <h1>后台管理系统</h1>
        <form action="" method="post"  class="layui-form layui-form-pane ">
            <input type="hidden" name="vertifyCode" id="vertifyCode" value="">
            <input class="txt-input txtpd" name="username" placeholder="用户名" id="username" lay-verify="required" type="text">
            <input id="password" name="password" placeholder="密码" class="txt-input txtpd" value="" lay-verify="required" type="password">
            <div id="drag"></div>
            <button id="regSubmit" lay-submit="" lay-filter="adminlogin">登陆</button>
            <br><br>

        </form>
    </div>
    <ul class="bg-bubbles">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>
<script type="text/javascript" src="/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript" src="/js/drag.js"></script>
<!--
<script src="http://open.sojson.com/common/js/canvas-nest.min.js" count="100" zindex="-2" opacity="0.5" color="#CD0000" type="text/javascript">
-->
<script>
    if(self != top){
        window.top.location.reload();
    }
    $('#drag').drag();
    layui.use(['form', 'element'], function () {
        var form = layui.form;
        //监听提交
        form.on('submit(adminlogin)', function (data) {
            var post_data = data.field;
            if(data.field.vertifyCode == ""){
                layer.alert("请滑动验证码");
                return false;
            }
            $.ajax({
                type: "POST",
                async: false,
                url: "/admin/loginSubmit",
                data: post_data,
                cache: false, //不缓存此页面
                success: function (data) {
                    if (data.code == '0') {

                        window.location.href = "/admin/index.html";
                    } else {
                        //layer.msg(msg.info, {time: 2000, icon:6});
                        layer.alert(data.msg, {
                            skin: 'layui-layer-lan'
                            , closeBtn: 0
                            , anim: 4 //动画类型
                        });


                    }

                }
            });
            return false;
        });


    });
</script>


<div class="layui-layer-move"></div>
</body>
<div></div>
</html>